import winreg
def add_to_startup(filePath):
    key = winreg.HKEY_CURRENT_USER
    key_value = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
    value = "C:\\Users\\yourusername\\path\\to\\yourscript.py"
    open_key = winreg.OpenKey(key, key_value, 0, winreg.KEY_ALL_ACCESS)# Replace with the path to your script
    winreg.SetValueEx(open_key, "myApp", 0, winreg.REG_SZ, filePath) # Replace "yourscript" with the name you want to give to your script in the startup folder
    winreg.CloseKey(open_key)

add_to_startup("d:/a.exe")